package com.xhs.service.impl;

import com.xhs.service.Thread8Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @desc: 异步注解+线程池创建多线程
 * @projectName: tools-parent
 * @author: xhs
 * @date: 2022/12/5 21:17
 * @version: JDK 1.8
 */
@Slf4j
@Service
public class Thread8ServiceImpl implements Thread8Service {

    /**
     * 异步记录日志
     */
    @Override
    @Async("taskExecutor")
    public void asyncThread() {
        log.info(">>>>>>>>>>>>>>使用Spring的@Async异步注解+线程池创建多线程,我是子线程:{}<<<<<<<<<<<<<<<<<<<<", Thread.currentThread().getName());
    }
}
